import request from '@/util/network_request/request.ts'
/***    
request.globalRequest(url,请求方式,obj数据,123,true单,true 多array)url, method, data, power, isUpload, isFiles
1===没登录前的请求头
2===携带请求头token
3===刷新token
***/
const apiOrder = {}

// 获取服务商工单列表
apiOrder.getNetworkOrderList = (data) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderList`,
	method: 'POST',
	data,
	power: 2
})
// 获取服务商工单列表状态数量
apiOrder.getNetworkOrderListStatusQty = (data) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderListStatusQty`,
	method: 'POST',
	data,
	power: 2
})
// 工单详情
apiOrder.getNeworkOrderDetail = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNeworkOrderDetail/${workId}`,
	method: 'get',
	power: 2
})
// 工单详情-工单
apiOrder.getNetworkOrderDetailContent = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderDetailContent/${workId}`,
	method: 'get',
	power: 2
})
// 工单详情-根据工单ID获取工单日志进展
apiOrder.getNetworkOrderLog = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderLog/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 工单详情 - 根据工单ID获取最新进展
apiOrder.getNetworkOrderLastLog = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderLastLog/${workId}`,
	method: 'get',
	power: 2
})
// 工单详情-商品
apiOrder.getNetworkOrderDetailGoods = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderDetailGoods/${workId}`,
	method: 'get',
	power: 2
})
// 工单详情-商品-商品编码
apiOrder.getNetworkOrderDetailGoodsCode = (workGoodsId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkOrderDetailGoodsCode/${workGoodsId}`,
	method: 'get',
	power: 2
})
// 服务商申请取消工单
apiOrder.networkApplyCancelOrder = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkApplyCancelOrder/${workId}`,
	method: 'post',
	data,
	power: 2
})
//服务商拒绝接单
apiOrder.networkRefuseReceiveOrder = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkRefuseReceiveOrder/${workId}`,
	method: 'post',
	data,
	power: 2
})
//服务商确认接单
apiOrder.networkSureReceiveOrder = (workId, data) => request.globalRequest({
	url: `/mobile/network/order/networkSureReceiveOrder/${workId}`,
	method: 'post',
	power: 2,
    data
})
//服务工程师申请工单挂起
apiOrder.networkEmpApplySuspendOrder = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkEmpApplySuspendOrder/${workId}`,
	method: 'post',
	data,
	power: 2
})
//服务工程师取消工单挂起
apiOrder.networkEmpRestartSuspendOrder = (workId) => request.globalRequest({
	url: `/mobile/network/order/networkEmpRestartSuspendOrder/${workId}`,
	method: 'post',
	power: 2
})
//获取服务商派单工程师
apiOrder.getNetworkDispatchEngineer = (data) => request.globalRequest({
	url: `/mobile/network/order/getNetworkDispatchEngineer`,
	method: 'post',
	data,
	power: 2
})
//服务商派工
apiOrder.networkDispatchEngineer = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkDispatchEngineer/${workId}`,
	method: 'post',
	data,
	power: 2
})
//预约时间
apiOrder.networkReservationTime = (data) => request.globalRequest({
	url: `/mobile/network/order/networkReservationTime`,
	method: 'post',
	data,
	power: 2
})
//获取结单模板及字段
apiOrder.getFinishOrderTemplateField = (workId) => request.globalRequest({
	url: `/mobile/network/order/getFinishOrderTemplateField/${workId}`,
	method: 'get',
	power: 2
})
// 根据工单ID获取服务商结单信息
apiOrder.getNetworkStatementInfo = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkStatementInfo/${workId}`,
	method: 'get',
	power: 2
})
// 根据工单ID获取结单核销码
apiOrder.getNetworkWriteOffCode = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkWriteOffCode/${workId}`,
	method: 'get',
	power: 2
})
// 服务工程师申请结单
apiOrder.networkApplyFinishOrder = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkApplyFinishOrder/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 申请改派服务商
apiOrder.networkApplyChangeNetwork = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkApplyChangeNetwork/${workId}`,
	method: 'post',
	data,
	power: 2
})
//服务商审核工程师转单申请
apiOrder.networkCheckTransferEngineer = (data) => request.globalRequest({
	url: `/mobile/network/order/networkCheckTransferEngineer`,
	method: 'post',
	data,
	power: 2
})
//获取预约时间范围
apiOrder.getNetworkReservationTimeRange = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkReservationTimeRange/${workId}`,
	method: 'get',
	power: 2
})
//工程师签到
apiOrder.networkEngineerSign = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkEngineerSign/${workId}`,
	method: 'post',
	data,
	power: 2
})
//根据工单ID获取签到设置
apiOrder.getNetworkEmpSignSet = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkEmpSignSet/${workId}`,
	method: 'get',
	power: 2
})
//根据工单ID获取是否开启签到
apiOrder.getNetworkEmpIsEnableSign = (workId) => request.globalRequest({
	url: `/mobile/network/order/getNetworkEmpIsEnableSign/${workId}`,
	method: 'get',
	power: 2
})
// 工程师申请转单-转派工程师-服务商直接转派工单师
apiOrder.networkApplyTransferEngineer = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/networkApplyTransferEngineer/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 保存拨打电话记录
apiOrder.saveCallPhoneLog = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/saveCallPhoneLog/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 保存申请费用
apiOrder.saveApplyFee = (data, workId) => request.globalRequest({
	url: `/mobile/network/order/saveApplyFee/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 根据工单ID获取是否费用全包
apiOrder.getOrderAllInclusiveFee = (workId) => request.globalRequest({
	url: `/mobile/network/order/getOrderAllInclusiveFee/${workId}`,
	method: 'get',
	power: 2
})
// 获取移动端工单服务费用下拉数据
apiOrder.getOrderServiceFeeSelect = () => request.globalRequest({
	url: `/mobile/select/getOrderServiceFeeSelect`,
	method: 'get',
	power: 2
})
//保存申请工单配件
apiOrder.saveApplySpare = (data) => request.globalRequest({
	url: `/mobile/network/order/saveApplySpare`,
	method: 'post',
	data,
	power: 2
})
// 获取移动端配件下拉数据
apiOrder.getMobileSpareSelect = (data, workId) => request.globalRequest({
	url: `/mobile/select/getMobileSpareSelect/${workId}`,
	method: 'post',
	data,
	power: 2
})
// 获取移动端配件规格下拉数据
apiOrder.getOrderSpareSpecSelect = (data, spareId) => request.globalRequest({
	url: `/mobile/select/getOrderSpareSpecSelect/${spareId}`,
	method: 'post',
	data,
	power: 2
})
// 获取服务商地址
apiOrder.getMobileOrderNetworkAddress = (workId) => request.globalRequest({
	url: `/mobile/network/order/getMobileOrderNetworkAddress/${workId}`,
	method: 'get',
	power: 2
})
// 获取工单客户地址
apiOrder.getMobileWorkUserAddress = (workId) => request.globalRequest({
	url: `/mobile/network/order/getMobileWorkUserAddress/${workId}`,
	method: 'get',
	power: 2
})
// 保存触发拨打电话
apiOrder.saveTriggerCallPhone = (workId) => request.globalRequest({
	url: `/mobile/network/order/saveTriggerCallPhone/${workId}`,
	method: 'post',
	power: 2
})
// 根据工单ID获取工单挂起设置
apiOrder.getOrderSuspendConfig = (workId) => request.globalRequest({
	url: `/mobile/network/order/getOrderSuspendConfig/${workId}`,
	method: 'get',
	power: 2
})
// 获取费用信息
apiOrder.getOrderFeeInfo = (workId) => request.globalRequest({
	url: `/mobile/network/order/getOrderFeeInfo/${workId}`,
	method: 'get',
	power: 2
})

/**
 * 叮咚提交服务商签单图url
 * @param data - 请求参数
 * @param data.id - 工单id
 * @param data.urls - 图片路径列表
 */
apiOrder.uploadServiceReceiptImage = (data) => request.globalRequest({
	url: '/mobile/network/order/signImage',
	method: 'post',
	power: 2,
	data,
})

export default apiOrder